#ifndef UNIT_TYPE_HPP_INCLUDED
#define UNIT_TYPE_HPP_INCLUDED

#include <string>
#include <vector>

#include "formula_callable.hpp"
#include "texture.hpp"
#include "unit_type_fwd.hpp"
#include "wml_node_fwd.hpp"

class unit_type : public game_logic::formula_callable
{
public:
	static const_unit_type_ptr get(const std::string& key);

	explicit unit_type(wml::const_node_ptr node);

	const std::string& id() const { return id_; }
	const std::string& description() const { return description_; }
	const graphics::texture& texture() const { return texture_; }
	int cost() const { return cost_; }
	int movement() const { return movement_; }

	bool can_build_city() const { return ability_build_city_; }
private:
	variant get_value(const std::string& key) const;
	std::string id_;
	std::string description_;
	graphics::texture texture_;
	int cost_;
	int movement_;

	bool has_ability(const std::string& ability) const;
	std::vector<std::string> abilities_;
	bool ability_build_city_;
};

#endif
